<!DOCTYPE html>
<html>
{include file="head.html"}
<body> 
 <div class="header" >
    <a class="left-btn pointer" href="{$appkoudai}?m=koudai_dz&a=undz"><span class="iconfont icon-back"></span></a>
    <div class="title">用户未对账口袋详情</div>    
  </div>
{include file="koudai_dz/navdz.html"}

<div class="comblock">
 
  <table class="cart_change_list_table dztable">
    <caption>
    请从以下商品列表中挑选您本次无需退货、结账的商品，您可继续持有，等待下次结算
    </caption>
    <tbody>
    {foreach item=c from=$data.products}
      <tr>
        <td width="60"><img src="{$c.imgurl|images_site}.100x100.jpg" width="50" height="50"></td>
        <td><div class="tit">{$c.title}</div>
        	<div><span>￥{$c.order_price}</span> &nbsp; <span>{$c.amount}件</span></div>
        </td>
     
    
        <td width="70"> <div class="cart_num"><a class="DisDe" did="{$c.order_product_id}" order_id="{$data.order_id}" href="javascript:void(0)"><i>-</i></a><input disabled="" class="Amount" value="{$c.gznum}" autocomplete="off" maxlength="3"><a class="Increase"  did="{$c.order_product_id}" order_id="{$data.order_id}" href="javascript:void(0)"><i>+</i></a></div></td>
      </tr>
     {/foreach} 
      
    </tbody>
  </table>
</div>
<div style="height:50px;"></div>
<div class="bottom_cartfixed">
 	<div class="info">您本次挂账金额：<span class="num" id="gzmoney">{$gz_money}</span> 元  数量：<span id="gznum" class="num">{$gz_num}</span><br>
    无需挂账请直接点击确定 </div>
	<a href="{$appkoudai}?m=koudai_dz&a=duizhang&order_id={$data.order_id}&op=tuihuo" class="btn">确定挂账</a> 
    
   </div>
 <script>
 	$(function(){
		$(document).on("click",".Increase",function(){
			var obj=$(this);
			var p=obj.parents(".cart_num");
			var v=parseInt(p.find(".Amount").val());
			var nv=v+1;
			
			$.get("{$appkoudai}?m=koudai_dz&a=duizhangnum&ajax=1",{
				id:$(this).attr("did"),
				order_id:$(this).attr("order_id"),
				gznum:nv
			},function(data){
				if(data.error){
					skyToast(data.message);
				}else{
					p.find(".Amount").val(nv);
					$("#gzmoney").html(data.data.gz_money);
					$("#gznum").html(data.data.gz_num);
				}
			},"json")
		});
		
		$(document).on("click",".DisDe",function(){
			var obj=$(this);
			var p=obj.parents(".cart_num");
			var v=parseInt(p.find(".Amount").val());
			var nv=Math.max(0,v-1);
			
			$.get("{$appkoudai}?m=koudai_dz&a=duizhangnum&ajax=1",{
				id:$(this).attr("did"),
				order_id:$(this).attr("order_id"),
				gznum:nv
			},function(data){
				if(data.error){
					skyToast(data.message);
				}else{
					p.find(".Amount").val(nv);
					$("#gzmoney").html(data.data.gz_money);
					$("#gznum").html(data.data.gz_num);
				}
			},"json")
		});
		
	});
 </script>
</body>
</html>